package com.sync.data.mce.entity;

import com.sync.data.base.BaseEntity;
import com.sync.data.common.annotation.FieldProps;
import com.sync.data.common.annotation.FieldType;
import com.sync.data.common.annotation.RenderAs;
import com.sync.data.common.annotation.RenderType;
import com.sync.data.common.obj.annoation.ObjectPrefix;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;

import javax.persistence.Entity;
import java.io.Serializable;

/**
 * @author xianchuang.li
 * @version 1.0.0
 * @description 实体类对应 core_dict 表
 * @since 2025/4/8 11:27
 **/
@Entity
@Getter
@Setter
@ObjectPrefix("crdt")
public class CoreDict extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @FieldProps(type = FieldType.STRING, label = "字典值")
    private String code;

    @FieldProps(type = FieldType.STRING, label = "名称")
    private String name;

    @FieldProps(type = FieldType.STRING, label = "对象")
    private String object;

    @FieldProps(type = FieldType.STRING, label = "字段")
    private String attribute;

    @FieldProps(type = FieldType.STRING, label = "label")
    private String label;

    @FieldProps(type = FieldType.STRING, label = "扩展属性")
    private String extend;

    @FieldProps(type = FieldType.STRING, label = "图标")
    private String icon;

    @FieldProps(type = FieldType.STRING, label = "别名")
    private String alias;

    @FieldProps(type = FieldType.STRING, label = "子对象")
    private String subObject;

    @FieldProps(type = FieldType.STRING, label = "属性")
    private String props;

    /**
     * 状态
     */
    @Column(name = "status")
    @FieldProps(type = FieldType.DICT, label = "状态", defaultValue = "1", renderType = RenderType.Select,notNull = true,renderAs = RenderAs.Tag)
    private String statusField;

    @FieldProps(type = FieldType.STRING, label = "备注")
    private String remark;
}
